﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DTO;
using DAO;
using System.Data;
namespace BUS
{
    public class KhachHangBUS
    {
        public List<KhachHangDTO> GetKhachHangAll()
        {
            KhachHangDAO dao = new KhachHangDAO();
            return dao.GetKhachHangAll();
        }
        public List<KhachHangDTO> SelectKhachHangLikeTen(KhachHangDTO tenkhachhang)
        {
            KhachHangDAO dao = new KhachHangDAO();
            return dao.SelectKhachHangLikeTen(tenkhachhang);
        }
        public List<KhachHangDTO> SelectKhachHangLikeDienThoai(KhachHangDTO sodienthoai)
        {
            KhachHangDAO dao = new KhachHangDAO();
            return dao.SelectKhachHangLikeDienThoai(sodienthoai);
        }
        public List<KhachHangDTO> SelectKhachHangLikeEmail(KhachHangDTO email)
        {
            KhachHangDAO dao = new KhachHangDAO();
            return dao.SelectKhachHangLikeEmail(email);
        }
        public List<KhachHangDTO> SelectKhachHangLikeDiaChi(KhachHangDTO diachi)
        {
            KhachHangDAO dao = new KhachHangDAO();
            return dao.SelectKhachHangLikeDiaChi(diachi);
        }
        // ---------------- LOI ---------------------------
        public List<KhachHangDTO> LayDanhSachKhachHangL()
        {
            KhachHangDAO khDAO = new KhachHangDAO();
            return khDAO.LayDanhSachKhachHangL();
        }
        public string ThemKhachHangL(KhachHangDTO khDTO)
        {
            KhachHangDAO khDAO = new KhachHangDAO();
            return khDAO.ThemKhachHangL(khDTO);
        }
        public int LayMaKhachHangL()
        {
            KhachHangDAO khDAO = new KhachHangDAO();
            return khDAO.LayMaKhachHangL();
        }
        public int KiemTraTonTaiKhachHangL(string tenkh, string sdt, string diachi)
        {
            KhachHangDAO khDAO = new KhachHangDAO();
            return khDAO.KiemTraTonTaiKhachHangL(tenkh, sdt, diachi);
        }
        public string XoaKhachHangL(int maKH)
        {
            KhachHangDAO khDAO = new KhachHangDAO();
            return khDAO.XoaKhachHangL(maKH);
        }
        public KhachHangDTO LayTenThongTinKhachHangTheoMaL(int maKH)
        {
            KhachHangDAO khDAO = new KhachHangDAO();
            return khDAO.LayTenThongTinKhachHangTheoMaL(maKH);
        }
        // END --------------- LOI ----------------
        //------------------HAI----------------
        public List<KhachHangDTO> LayDanhSachKhachHang()
        {
            KhachHangDAO khDAO = new KhachHangDAO();
            return khDAO.LayDanhSachKhachHang();
        }
        public string ThemKhachHang(KhachHangDTO khDTO)
        {
            KhachHangDAO khDAO = new KhachHangDAO();
            return khDAO.ThemKhachHang(khDTO);
        }
        public int LayMaKhachHang()
        {
            KhachHangDAO khDAO = new KhachHangDAO();
            return khDAO.LayMaKhachHang();
        }
        public int KiemTraTonTaiKhachHang(string tenkh, string sdt, string diachi)
        {
            KhachHangDAO khDAO = new KhachHangDAO();
            return khDAO.KiemTraTonTaiKhachHang(tenkh, sdt, diachi);
        }
        public string XoaKhachHang(int maKH)
        {
            KhachHangDAO khDAO = new KhachHangDAO();
            return khDAO.XoaKhachHang(maKH);
        }
        public KhachHangDTO LayTenThongTinKhachHangTheoMa(int maKH)
        {
            KhachHangDAO khDAO = new KhachHangDAO();
            return khDAO.LayTenThongTinKhachHangTheoMa(maKH);
        }


        KhachHangDAO kh = new KhachHangDAO();

        public DataTable DataKhachHang()
        {
            return kh.DataKhachHang();
        }
        public void insert(KhachHangDTO k)
        {
            kh.insertkh(k);
        }
        public void Delete(int k)
        {
            kh.deletekh(k);
        }
        public void update(KhachHangDTO k)
        {
            kh.updatekh(k);
        }


        public int layMaKhachHang()
        {
            throw new NotImplementedException();
        }

        //-------------------END HAI--------------------
    }
}
